Skip to content

fix: Improve dynamic adjustment of prompt input height#4582

Merged
jperals merged 12 commits into
mainfrom
fix/prompt-input-dynamic-height
Jun 5, 2026
Merged

fix: Improve dynamic adjustment of prompt input height#4582
jperals merged 12 commits into
mainfrom
fix/prompt-input-dynamic-height

Conversation

@jperals
Copy link
Copy Markdown
Member

@jperals jperals commented Jun 4, 2026

Description

Update the input height not only on window resize, but also when the component itself changes width for whatever reason (for example, by expanding or collapsing drawers). Otherwise the prompt input height will become stale in these cases.

Issue: AWSUI-62050

How has this been tested?

  • Integration tests
  • Manually
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.45%. Comparing base (77cd842) to head (55343d1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4582      +/-   ##
==========================================
+ Coverage   97.43%   97.45%   +0.01%     
==========================================
  Files         941      942       +1     
  Lines       29692    29716      +24     
  Branches    10792    10800       +8     
==========================================
+ Hits        28930    28959      +29     
+ Misses        715      710       -5     
  Partials       47       47              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jperals jperals marked this pull request as ready for review June 4, 2026 11:07
@jperals jperals requested a review from a team as a code owner June 4, 2026 11:07
@jperals jperals requested review from amanabiy and removed request for a team June 4, 2026 11:07
@jperals jperals enabled auto-merge June 4, 2026 15:59
* @param elementRef - A ref object pointing to the element to observe.
* @param onWidthChange - Callback fired when the element's width changes.
*/
export function useWidthChange(elementRef: React.RefObject<HTMLElement>, onWidthChange: () => void): void {
Copy link
Copy Markdown
Member

@amanabiy amanabiy Jun 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use useResizeObserver instead of useWidthChange?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extended the comment text to explain the difference:

Unlike useResizeObserver from the component-toolkit package, it does not cause re-renders when the width changes.

@jperals jperals added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit e8193de Jun 5, 2026
51 checks passed
@jperals jperals deleted the fix/prompt-input-dynamic-height branch June 5, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants